{% extends "approval/base.html" %}
{% block title %} 更新项目 {% endblock %}
{% block content %}
    <style>
        ul.errorlist li {
            color: red;
        }
    </style>
    <div class="col-lg-6 col-lg-offset-3">
        <section class="panel panel-default">
            <div class="panel-heading">
                更新项目
                {% if form.errors %}
                    <div style="color:red">
                        {{ form.errors }}
                        您提交的数据有误,请认真检查!
                    </div>
                {% endif %}
            </div>
            <div class="panel-body" style="padding: 10px;">
                <form class="form-horizontal" method="post" action="{{ request.path }}" enctype="multipart/form-data">
                    {% csrf_token %}
                    <input type="hidden" name="updated_by" id="id_updated_by" value="{{ request.user.id }}">
                    <div class="form-group">
                        <div class="col-lg-2 control-label">{{ form.code.label_tag }}</div>
                        <div class="col-lg-4">
                            {{ form.code }}
                            <p class="help-block">{{ form.code.errors }}</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-lg-2 control-label">{{ form.name.label_tag }}</div>
                        <div class="col-lg-10">
                            {{ form.name }}
                            <p class="help-block">{{ form.name.errors }}</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-lg-2 control-label">{{ form.status.label_tag }}</div>
                        <div class="col-lg-4">
                            {{ form.status }}
                            <p class="help-block">{{ form.status.errors }}</p>
                        </div>
                        <div class="col-lg-2 control-label">{{ form.predict_amount.label_tag }}</div>
                        <div class="col-lg-4">
                            {{ form.predict_amount }}
                            <p class="help-block">{{ form.predict_amount.errors }}</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-lg-2 control-label">{{ form.date_start.label_tag }}</div>
                        <div class="col-lg-4">
                            {{ form.date_start }}
                            <p class="help-block">{{ form.date_start.errors }}</p>
                        </div>
                        <div class="col-lg-2 control-label">{{ form.date_finish.label_tag }}</div>
                        <div class="col-lg-4">
                            {{ form.date_finish }}
                            <p class="help-block">{{ form.date_finish.errors }}</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-lg-2 control-label">{{ form.desc.label_tag }}</div>
                        <div class="col-lg-10">
                            {{ form.desc }}
                            <p class="help-block">{{ form.desc.errors }}</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-lg-12" align="right">
                            <button type="submit" class="btn btn-primary">提交</button>
                        </div>
                    </div>
                </form>
            </div>
        </section>
    </div>
{% endblock %}
{% block this_js %}
    <script>
        $('#id_date_start').datepicker({language: "zh-CN"});
        $('#id_date_finish').datepicker({language: "zh-CN"});
    </script>
{% endblock %}